﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkyFab.Master" AutoEventWireup="true" CodeBehind="MakeCustomerInvoice.aspx.cs" Inherits="Web.MakeCustomerInvoice" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:Label ID="FlashMessageLabel" runat="server"></asp:Label>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <h1>Customer Invoice</h1>

    <div class="span-9">
    <fieldset>
        <legend>Customer Information</legend>
            
        <p>
        <label>Customer:</label>
            <asp:DropDownList ID="CustomerDropDownList" runat="server" Width="150" 
                AutoPostBack="True" 
                onselectedindexchanged="CustomerDropDownList_SelectedIndexChanged"/>
        </p>
            
        <p>
        <label>PO No:</label>
         <asp:DropDownList ID="PONoDropDownList" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="PONoDropDownList_SelectedIndexChanged" 
                        CssClass="WindowsStyle" Width="220">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="PONoDropDownList" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
        </p>
    </fieldset>
    </div>

    <div class="span-9">
    <fieldset>
    <legend>Invoice Information</legend>
    
    <p>
    <label>Invoice No: </label><asp:TextBox ID="InvoiceNoTextBox" runat="server" CssClass="text" Width="150"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="InvoiceNoTextBox" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
    </p>

    <p>
    <label>Date:</label>
    <asp:TextBox ID="DateTextBox" runat="server" CssClass="text" Width="130"></asp:TextBox>
                <asp:CalendarExtender ID="DateTextBox_CalendarExtender" runat="server" 
                    Enabled="True" TargetControlID="DateTextBox" Format="d MMM, yyyy">
                </asp:CalendarExtender>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="DateTextBox" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>

    <label>Is Paid ? : </label>
    <asp:CheckBox ID="PaidCheckBox" runat="server" Checked="true" />
    </p>

   

    </fieldset>
    </div>

    <div class="span-18">
    <fieldset>
    <legend>Select Product</legend>

    

    <p>
    <label>PO Item &amp; Requested Date:</label>
    <asp:DropDownList ID="ItemAndRequestedDateDropDownList" runat="server" AutoPostBack="True" 
                    
                    onselectedindexchanged="ItemAndRequestedDateDropDownList_SelectedIndexChanged">
            </asp:DropDownList>

    <label>Currency: </label>USD
    
    </p>

    <p>
    <label>Batch No: </label>
    <asp:DropDownList ID="BatchNoDropDownList" runat="server" Width="150">
                </asp:DropDownList>
   
    <label>Quantity:</label>
    <asp:TextBox ID="QuantityTextBox" runat="server" CssClass="text" Width="80"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="QuantityTextBox" ErrorMessage="*" 
                    ValidationExpression="^[1-9]\d*$" ForeColor="Red"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="QuantityTextBox" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
    
    <label>Unit Price:</label>
    <asp:Label ID="UnitPriceLabel" runat="server" Width="100"></asp:Label>

    <asp:Button ID="InsertButton" runat="server" Text="Insert" 
                    onclick="InsertButton_Click" CssClass="submitButton" />
    </p>
    </fieldset>
    </div>

    <div class="span-18">
    <fieldset>
    <legend>Product List</legend>

    <p>
    <asp:GridView ID="CustomerInvoiceItemGridView" runat="server" AutoGenerateColumns="False" 
                    CellPadding="4" GridLines="None" CssClass="gridview" Width="100%">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="ProductNo" HeaderText="No" />
                        <asp:BoundField DataField="ProductName" HeaderText="Name" />
                        <asp:BoundField DataField="Revision" HeaderText="Rev." />
                        <asp:TemplateField HeaderText="QTY">
                            <ItemTemplate>
                                <asp:TextBox ID="qtyTextBox" runat="server" Height="18px" Width="41px" 
                                    Text='<%#Eval("Quantity") %>' Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Unit Price">
                            <ItemTemplate>
                                <asp:TextBox ID="unitPriceTextBox" runat="server" Height="17px" Width="56px" 
                                    Text='<%#Eval("UnitPrice") %>' Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                           
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Delete">
                            <ItemTemplate>
                                <asp:Button ID="DeleteButton" runat="server" onclick="DeleteButton_Click" 
                                    Text="Delete" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField Visible="False">
                            <ItemTemplate>
                                <asp:HiddenField ID="ProductIdHiddenField" runat="server" Value='<%#Eval("ProductId") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField Visible="False">
                            <ItemTemplate>
                                <asp:HiddenField ID="CustPoItemIdHiddenField" runat="server" Value='<%#Eval("CustPoItemId") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                   
                    <AlternatingRowStyle BackColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle HorizontalAlign="Center" CssClass="pagerTable" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
    </p>

    <p>
    <label>Sub Total:</label>
    <asp:Label ID="SubTotalLabel" runat="server"></asp:Label>
    </p>
    
    
    <p>
   <label>Shipping Address:</label>
   <asp:Label ID="ShippingAddressLabel" runat="server"></asp:Label>
   </p>

   <p>
   <label>Shipping Mode:</label>

   <label>Shipping &amp; Insurance:</label>
    <asp:TextBox ID="ShippingAndInsuranceTextBox" runat="server" 
                    AutoPostBack="True" ontextchanged="ShippingAndInsuranceTextBox_TextChanged" CssClass="text" Width="80"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="ShippingAndInsuranceTextBox" ErrorMessage="*" 
                    ForeColor="Red" ValidationExpression="^[0-9]+(.[0-9]{1,3})?$"></asp:RegularExpressionValidator>

   <label>Shipping Weight:</label>
   <asp:TextBox ID="WeightTextBox" runat="server" CssClass="text" Width="100" 
           AutoPostBack="True" ontextchanged="ShippingAndInsuranceTextBox_TextChanged"></asp:TextBox>
   </p>

    <p>
    <label>Total:</label>
    <asp:Label ID="TotalLabel" runat="server" Width="120"></asp:Label>
    </p>
    </fieldset>
    </div>
   

   <div class="span-18">
   <asp:Button ID="SubmitButton" runat="server" Text="Submit" onclick="SubmitButton_Click" CssClass="submitButton" />
   </div>

   <div class="span-18">
   <fieldset>
   <legend>Export PDF</legend>
   <asp:Button ID="InvoicePDFButton" runat="server" 
                    onclick="InvoicePDFButton_Click" Text="Customer Invoice" CssClass="submitButton" />

   <asp:Button ID="PackagePDFButton" runat="server" 
                    onclick="PackagePDFButton_Click" Text="Package" CssClass="submitButton"/>

   <asp:Button ID="ItemPDFButton" runat="server" onclick="ItemPDFButton_Click" 
                    Text="Package Item" CssClass="submitButton"/>
   </fieldset>
   </div>
    
</asp:Content>
